package com.isec.base.monit.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.core.security.database.jdbc.BaseDao;
import com.isec.base.monit.dto.DataLogDto;

@Repository
public class DataLogDao extends BaseDao<DataLogDto, String>{

	public DataLogDto getLastData(String dataType) {
		return this.getObject("SELECT * from IGDAR_DATALOG_TAB where DATATYPE = ? ORDER BY DATAINDEX DESC LIMIT 1", dataType);
	}
	
	public List<DataLogDto> getAllData(String dataType) {
		return this.getList("SELECT * from IGDAR_DATALOG_TAB where DATATYPE = ? ORDER BY DATAINDEX", dataType);
	}
}
